<?php
/**
 *Template Name: Sitemap template
 */
get_header();
get_template_part( 'slider2' );

$pageId = $post->ID;
?>
	<div class="content">
		<div class="template clear-fix" id="casestudy">
			<div class="heading clear-fix">
				<h2><?php echo $page->post_title?></h2>
			</div>
			<div class="tpl-full clear-fix">
				<div id="sitemap-link">				
				<?php
					$page = do_shortcode('[pagelist include="2,7,11,17,20,22,24"]');
																				
					$page = preg_replace('/<ul class="([^"]*?)">/','<ul class="$1"><li><a href="index.php" id="sitelink-1">FORSIDE</a></li>',$page,1);
					$page = preg_replace('/<a.*?href="([^"]*?)page_id=2"/','<a href="$1page_id=57" id="sitelink-2"',$page,1);			
					$page = preg_replace('/(<a.*?href="[^"]*?page_id=7")/','$1 id="sitelink-3"',$page,1);
					$page = preg_replace('/<a.*?href="([^"]*?)page_id=11"/','<a href="$1gallery=butik-forretning" id="sitelink-4"',$page,1);
					$page = preg_replace('/(<a.*?href="[^"]*?page_id=17")/','$1 id="sitelink-5"',$page,1);					
					$page = preg_replace('/(<a.*?href="[^"]*?page_id=20")/','$1 id="sitelink-6"',$page,1);
					$page = preg_replace('/(<a.*?href="[^"]*?page_id=22")/','$1 id="sitelink-7"',$page,1);
					$page = preg_replace('/(<a.*?href="[^"]*?page_id=24")/','$1 id="sitelink-8"',$page,1);
				
					echo $page;					
				?>	
				</div>
				<?php
					$page 	= get_page($pageId);
					echo $page->post_content;  
				?>
			</div>				
		</div>
	</div>
<?php get_footer(); ?>
